Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
standard-ecies
Advanced tools
Standard ECIES implemention for NodeJS based on crypto module with no other dependencies.
Standard ECIES (ecc encryption) implemention for NodeJS based on crypto
module with no other dependencies.
I have tried most of ECIES implemention published on npm, but none of them is exactly what I wanted. sjcl and secp256k1 are not friendly for windows users when compiling their code, so the projects based on them like eccjs and eccrypto are not easy for windows users, either. bitcore-ecies is friendly for windows but its implemention is customized for author's own purpose, not widely applicable.
The implemention is followed by the description in https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme .
Support all of curves listed in crypto.getCurves()
.
const crypto = require('crypto');
const ecies = require('standard-ecies');
// option parameter is optional, all options are optional except iv,
// when symmetric cipher is not in ecb mode, iv option must be offered.
// default options
var options = {
hashName: 'sha256',
hashLength: 32,
macName: 'sha256',
macLength: 32,
curveName: 'secp256k1',
symmetricCypherName: 'aes-256-ecb',
iv: null, // iv is used in symmetric cipher, set null if cipher is in ECB mode.
keyFormat: 'uncompressed',
s1: null, // optional shared information1
s2: null // optional shared information2
}
var ecdh = crypto.createECDH(options.curveName);
ecdh.generateKeys();
var plainText = new Buffer('hello world');
var encryptedText = ecies.encrypt(ecdh.getPublicKey(), plainText, options);
var decryptedText = ecies.decrypt(ecdh, encryptedText, options);
assert(plainText.toString('hex') == decryptedText.toString('hex'));
FAQs
Standard ECIES implemention for NodeJS based on crypto module with no other dependencies.
The npm package standard-ecies receives a total of 8 weekly downloads. As such, standard-ecies popularity was classified as not popular.
We found that standard-ecies demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.